<?php 
require_once 'includes/haut.php';
acces($niveau,0);
require_once 'modules/membre.php';
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>
			Mon compte
		</title>
		<?php include('includes/headLinks.php');?>
		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/i18n/jquery-ui-i18n.min.js"></script>
		<script type="text/javascript" src="js/dateNaissance.js"></script>
		<script type="text/javascript" src="js/formulairemodif.js"></script>
	</head>
	<body>

		<div id="entete">
		</div>
	
		<div id="navigation">
			<?php include('includes/navigation.php'); ?>
		</div>

		<div id="principal">
			<h2>Mes informations personnelles :</h2>
			
			<?php 
			
			if(isset($_GET["action"]) && $_GET["action"]=="modifier"){
			?>
			<form action="monCompte.php?action=modifier" method="post" id="formmodif">
				<div class="error">
				<?php 
					if(isset($erreurs))
						echo $erreurs;
						
				?>
				</div>
				<table >			
			       	<tr>
			       		<td><label for="nom">Nom : </label></td>
		 				<td><input type="text" name="nom" id="nom" maxlength="30" value="<?php echo $client->getNom() ;?>"/></td>
		 				<td><img class="pastillePseudo" src="images/icones/error.png" alt="nom_error" title="Pseudo indisponible" />
	      				<img class="pastillePseudo" src="images/icones/ok.png" alt="nom_ok" title="Pseudo disponible" />
	      				<span class="error"></span>
	      			</td>  
			 		</tr>
			 		<tr>
		    	  		<td><label for="prenom">Pr&eacute;nom : </label></td>
		      			<td><input type="text" name="prenom" id="prenom" maxlength="30" value="<?php echo $client->getPrenom() ;?>"/></td>
		      			<td><img class="pastillePseudo" src="images/icones/error.png" alt="prenom_error" title="Pseudo indisponible" />
	      				<img class="pastillePseudo" src="images/icones/ok.png" alt="prenom_ok" title="Pseudo disponible" />
	      				<span class="error"></span>
	      			</td>
		      		</tr>
		      		<tr>
			      		<td><label for="email">E-mail : </label></td>
		      			<td><input type="email" name="email" id="email" maxlength="50" value="<?php echo $client->getEmail() ;?>"/></td>
		      			<td><img class="pastillePseudo" src="images/icones/error.png" alt="email_error" title="Pseudo indisponible" />
	      				<img class="pastillePseudo" src="images/icones/ok.png" alt="email_ok" title="Pseudo disponible" />
	      				<span class="error"></span>
	      			</td>
		      		</tr>
		      		<tr>
		      			<td><label for="dateNaissance">Date de naissance :</label></td>
						<td><input type="text" name="dateNaissance" id="dateNaissance"
								maxlength="10" value="<?php echo $client->getDateNaissance() ;?>" />
						</td>
	      			</tr>
		      		<tr>
			      		<td>Sexe :</td>
		      			<td>
			      			<input type="radio" name="sexe" value="f" id="femme" <?php if($client->getSexe()!="h" ) echo 'checked="checked"';?> />
		      				<label for="femme">Femme</label>
		      				<input type="radio" name="sexe" value="h" id="homme" <?php if($client->getSexe()=="h") echo 'checked="checked"';?>/>
		      				<label for="homme">Homme</label>
		      			</td>
		      		</tr>
		      		<tr>
		      			<td><label for="ancien_mdp">Ancien mot de passe : </label></td>
		      			<td><input type="password" name="ancien_mdp" id="ancien_mdp" maxlength="30"/></td>
		      			<td><img class="pastillePseudo" src="images/icones/error.png" alt="pass_error" title="Pseudo indisponible" />
	      				<img class="pastillePseudo" src="images/icones/ok.png" alt="pass_ok" title="Pseudo disponible" />
	      				<span class="error"></span>
	      			</td>
		      		</tr>
		      		<tr>
			      		<td><label for="mdp">Nouveau mot de passe : </label></td>
		      			<td><input type="password" name="mdp" id="mdp" maxlength="30"/></td>
		      		</tr>
		      		<tr>
		      			<td><label for="verif_mdp">Verification nouveau mot de passe : </label></td>
		      			<td><input type="password" name="verif_mdp" id="verif_mdp" maxlength="30" /></td>
		      		</tr>
		    	</table>
		    	
	      		<p><center>
	      			<input type="submit" id="envoyer" name="envoyer" value="Envoyer"/>
		      		
				</center></p>
				<p>
				<input type="hidden" name="action" value="modifier"/>
				</p>
			</form>
			
			<?php 
			}
			else{
			?>
				<table >			
			       	<tr>
			       		<th>Nom :</th>
		 				<td class="capitalize"><?php echo $client->getNom(); ?></td>  
			 		</tr>
			 		<tr>
		    	  		<th>Pr&eacute;nom : </th>
		      			<td class="capitalize"><?php echo $client->getPrenom();  ?></td>
		      		</tr>
		      		<tr>
			      		<th>E-mail : </th>
		      			<td><?php echo $client->getEmail();  ?></td>
		      		</tr>
		      		<tr>
		      			<th>Date de naissance :</th>
						<td><?php echo $client->getDateNaissance() ;?></td>
	      			</tr>
		      		
		       		<tr>
			      		<th>Sexe :</th>
		      			<td><?php if ($client->getSexe() =="f") echo "Femme";
		      					else echo "Homme";  ?></td>
		      		</tr>
					<tr>
			      		<th>Nom d'usager :</th>
		      			<td><?php echo $client->getNomUsager();  ?></td>
		      		</tr>
		    	</table></br></br>
	    	
	    		<center><a href="monCompte.php?action=modifier">Modifier</a></center>
			<?php }?>
			
		</div>
		
		<div id="form_connexion">
			<?php include('includes/formConnexion.php'); ?>
		</div>
	</body>
</html>